package Io;

import java.io.*;

public class CopyDemo2 {
    public static void main(String[] args) throws IOException {
        BufferedInputStream bis = new BufferedInputStream( new FileInputStream("123.jpg"),2048);
        BufferedOutputStream bos = new BufferedOutputStream( new FileOutputStream("123_4.jpg"),2048);
        long a = System.currentTimeMillis();
        int b;
        while(( b= bis.read())!=-1){
            bos.write(b);
        }
        long c = System.currentTimeMillis();
        System.out.println("耗时"+(c-a));
    }
}
